<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        var o = {
            extend: function () {
                for (var i = 0; i < arguments.length; i++) {
                    for (var k in arguments[i]) {
                        this[k] = arguments[i][k];
                    }
                }
            }
        }
        function Person(name) {
            this.name = name;
        }
        Person.prototype = o;
        function Student(num) {
            this.num = num;

        }
        Student.prototype = new Person('刘德华');
        var stu = new Student('110');
        console.log(stu.name);
        function Zuzhang() {
            this.sleep = function () {
                console.log('睡觉');

            }
            this.extend = Person.prototype.extend;
        }
        Zuzhang.prototype = stu;
        var zz = new Zuzhang();
        zz.extend({ age: 19 });
        console.log(zz);

    </script>
</body>

</html>